{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 读取数据\n",
    "使用了pandas自带的read_csv()函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "dataset = pd.read_csv('./gaze.csv')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 题目1\n",
    "取confidence>=0.9的记录"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>gaze_timestamp</th>\n",
       "      <th>world_index</th>\n",
       "      <th>confidence</th>\n",
       "      <th>norm_pos_x</th>\n",
       "      <th>norm_pos_y</th>\n",
       "      <th>base_data</th>\n",
       "      <th>gaze_point_3d_x</th>\n",
       "      <th>gaze_point_3d_y</th>\n",
       "      <th>gaze_point_3d_z</th>\n",
       "      <th>eye_center0_3d_x</th>\n",
       "      <th>...</th>\n",
       "      <th>eye_center0_3d_z</th>\n",
       "      <th>gaze_normal0_x</th>\n",
       "      <th>gaze_normal0_y</th>\n",
       "      <th>gaze_normal0_z</th>\n",
       "      <th>eye_center1_3d_x</th>\n",
       "      <th>eye_center1_3d_y</th>\n",
       "      <th>eye_center1_3d_z</th>\n",
       "      <th>gaze_normal1_x</th>\n",
       "      <th>gaze_normal1_y</th>\n",
       "      <th>gaze_normal1_z</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>88150.825638</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493612</td>\n",
       "      <td>0.398950</td>\n",
       "      <td>88150.827729-0 88150.823548-1</td>\n",
       "      <td>2.412810</td>\n",
       "      <td>-21.468145</td>\n",
       "      <td>-295.071057</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150041</td>\n",
       "      <td>0.234536</td>\n",
       "      <td>0.960458</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>88150.827729</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493561</td>\n",
       "      <td>0.399305</td>\n",
       "      <td>88150.827729-0 88150.827729-1</td>\n",
       "      <td>2.429837</td>\n",
       "      <td>-21.374413</td>\n",
       "      <td>-294.819200</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150243</td>\n",
       "      <td>0.234115</td>\n",
       "      <td>0.960530</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>88150.829663</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493570</td>\n",
       "      <td>0.399542</td>\n",
       "      <td>88150.827729-0 88150.83159799999-1</td>\n",
       "      <td>2.427118</td>\n",
       "      <td>-21.328193</td>\n",
       "      <td>-294.874516</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150210</td>\n",
       "      <td>0.233747</td>\n",
       "      <td>0.960624</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>88150.866015</td>\n",
       "      <td>3</td>\n",
       "      <td>0.922197</td>\n",
       "      <td>0.492592</td>\n",
       "      <td>0.398705</td>\n",
       "      <td>88150.867514-0 88150.86451599999-1</td>\n",
       "      <td>2.827911</td>\n",
       "      <td>-21.750938</td>\n",
       "      <td>-298.233245</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.060717</td>\n",
       "      <td>0.025220</td>\n",
       "      <td>0.997836</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149814</td>\n",
       "      <td>0.233510</td>\n",
       "      <td>0.960744</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>88150.869620</td>\n",
       "      <td>3</td>\n",
       "      <td>0.922197</td>\n",
       "      <td>0.492635</td>\n",
       "      <td>0.398814</td>\n",
       "      <td>88150.867514-0 88150.871726-1</td>\n",
       "      <td>2.813774</td>\n",
       "      <td>-21.744854</td>\n",
       "      <td>-298.471253</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.060717</td>\n",
       "      <td>0.025220</td>\n",
       "      <td>0.997836</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149645</td>\n",
       "      <td>0.233258</td>\n",
       "      <td>0.960831</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125259</th>\n",
       "      <td>88443.695600</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.995336</td>\n",
       "      <td>0.407831</td>\n",
       "      <td>0.413470</td>\n",
       "      <td>88443.69561-0 88443.695591-1</td>\n",
       "      <td>327.648915</td>\n",
       "      <td>-173.027524</td>\n",
       "      <td>-2777.243340</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.110854</td>\n",
       "      <td>0.041843</td>\n",
       "      <td>0.992955</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.130868</td>\n",
       "      <td>0.093021</td>\n",
       "      <td>0.987026</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125260</th>\n",
       "      <td>88443.697571</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.948733</td>\n",
       "      <td>0.407552</td>\n",
       "      <td>0.414731</td>\n",
       "      <td>88443.69561-0 88443.69953099999-1</td>\n",
       "      <td>311.054477</td>\n",
       "      <td>-161.381388</td>\n",
       "      <td>-2628.637408</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.110854</td>\n",
       "      <td>0.041843</td>\n",
       "      <td>0.992955</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.132037</td>\n",
       "      <td>0.091860</td>\n",
       "      <td>0.986979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125261</th>\n",
       "      <td>88443.701580</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407467</td>\n",
       "      <td>0.414705</td>\n",
       "      <td>88443.703629-0 88443.69953099999-1</td>\n",
       "      <td>313.566509</td>\n",
       "      <td>-162.585330</td>\n",
       "      <td>-2647.420719</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.132037</td>\n",
       "      <td>0.091860</td>\n",
       "      <td>0.986979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125262</th>\n",
       "      <td>88443.703608</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407160</td>\n",
       "      <td>0.415340</td>\n",
       "      <td>88443.703629-0 88443.703587-1</td>\n",
       "      <td>297.019831</td>\n",
       "      <td>-152.352987</td>\n",
       "      <td>-2499.428189</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.133311</td>\n",
       "      <td>0.091656</td>\n",
       "      <td>0.986827</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125263</th>\n",
       "      <td>88443.705574</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407637</td>\n",
       "      <td>0.413674</td>\n",
       "      <td>88443.703629-0 88443.70751899999-1</td>\n",
       "      <td>323.629974</td>\n",
       "      <td>-170.142461</td>\n",
       "      <td>-2737.404466</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.131320</td>\n",
       "      <td>0.092941</td>\n",
       "      <td>0.986974</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>87442 rows × 21 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        gaze_timestamp  world_index  confidence  norm_pos_x  norm_pos_y  \\\n",
       "21        88150.825638            2    0.915197    0.493612    0.398950   \n",
       "22        88150.827729            2    0.915197    0.493561    0.399305   \n",
       "23        88150.829663            2    0.915197    0.493570    0.399542   \n",
       "39        88150.866015            3    0.922197    0.492592    0.398705   \n",
       "40        88150.869620            3    0.922197    0.492635    0.398814   \n",
       "...                ...          ...         ...         ...         ...   \n",
       "125259    88443.695600         8788    0.995336    0.407831    0.413470   \n",
       "125260    88443.697571         8788    0.948733    0.407552    0.414731   \n",
       "125261    88443.701580         8788    0.945284    0.407467    0.414705   \n",
       "125262    88443.703608         8788    0.945284    0.407160    0.415340   \n",
       "125263    88443.705574         8788    0.945284    0.407637    0.413674   \n",
       "\n",
       "                                 base_data  gaze_point_3d_x  gaze_point_3d_y  \\\n",
       "21           88150.827729-0 88150.823548-1         2.412810       -21.468145   \n",
       "22           88150.827729-0 88150.827729-1         2.429837       -21.374413   \n",
       "23      88150.827729-0 88150.83159799999-1         2.427118       -21.328193   \n",
       "39      88150.867514-0 88150.86451599999-1         2.827911       -21.750938   \n",
       "40           88150.867514-0 88150.871726-1         2.813774       -21.744854   \n",
       "...                                    ...              ...              ...   \n",
       "125259        88443.69561-0 88443.695591-1       327.648915      -173.027524   \n",
       "125260   88443.69561-0 88443.69953099999-1       311.054477      -161.381388   \n",
       "125261  88443.703629-0 88443.69953099999-1       313.566509      -162.585330   \n",
       "125262       88443.703629-0 88443.703587-1       297.019831      -152.352987   \n",
       "125263  88443.703629-0 88443.70751899999-1       323.629974      -170.142461   \n",
       "\n",
       "        gaze_point_3d_z  eye_center0_3d_x  ...  eye_center0_3d_z  \\\n",
       "21          -295.071057         20.000000  ...        -20.000000   \n",
       "22          -294.819200         20.000000  ...        -20.000000   \n",
       "23          -294.874516         20.000000  ...        -20.000000   \n",
       "39          -298.233245         20.000000  ...        -20.000000   \n",
       "40          -298.471253         20.000000  ...        -20.000000   \n",
       "...                 ...               ...  ...               ...   \n",
       "125259     -2777.243340         19.888755  ...        -20.707271   \n",
       "125260     -2628.637408         19.888755  ...        -20.707271   \n",
       "125261     -2647.420719         19.888755  ...        -20.707271   \n",
       "125262     -2499.428189         19.888755  ...        -20.707271   \n",
       "125263     -2737.404466         19.888755  ...        -20.707271   \n",
       "\n",
       "        gaze_normal0_x  gaze_normal0_y  gaze_normal0_z  eye_center1_3d_x  \\\n",
       "21            0.062883        0.025100        0.997705        -39.934928   \n",
       "22            0.062883        0.025100        0.997705        -39.934928   \n",
       "23            0.062883        0.025100        0.997705        -39.934928   \n",
       "39            0.060717        0.025220        0.997836        -39.934928   \n",
       "40            0.060717        0.025220        0.997836        -39.934928   \n",
       "...                ...             ...             ...               ...   \n",
       "125259       -0.110854        0.041843        0.992955        -37.372594   \n",
       "125260       -0.110854        0.041843        0.992955        -37.372594   \n",
       "125261       -0.111009        0.041794        0.992940        -37.372594   \n",
       "125262       -0.111009        0.041794        0.992940        -37.372594   \n",
       "125263       -0.111009        0.041794        0.992940        -37.372594   \n",
       "\n",
       "        eye_center1_3d_y  eye_center1_3d_z  gaze_normal1_x  gaze_normal1_y  \\\n",
       "21             14.997919        -20.075283       -0.150041        0.234536   \n",
       "22             14.997919        -20.075283       -0.150243        0.234115   \n",
       "23             14.997919        -20.075283       -0.150210        0.233747   \n",
       "39             14.997919        -20.075283       -0.149814        0.233510   \n",
       "40             14.997919        -20.075283       -0.149645        0.233258   \n",
       "...                  ...               ...             ...             ...   \n",
       "125259         14.763454        -23.294339       -0.130868        0.093021   \n",
       "125260         14.763454        -23.294339       -0.132037        0.091860   \n",
       "125261         14.763454        -23.294339       -0.132037        0.091860   \n",
       "125262         14.763454        -23.294339       -0.133311        0.091656   \n",
       "125263         14.763454        -23.294339       -0.131320        0.092941   \n",
       "\n",
       "        gaze_normal1_z  \n",
       "21            0.960458  \n",
       "22            0.960530  \n",
       "23            0.960624  \n",
       "39            0.960744  \n",
       "40            0.960831  \n",
       "...                ...  \n",
       "125259        0.987026  \n",
       "125260        0.986979  \n",
       "125261        0.986979  \n",
       "125262        0.986827  \n",
       "125263        0.986974  \n",
       "\n",
       "[87442 rows x 21 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result1 = dataset.copy(deep=True)\n",
    "result1 = result1.loc[dataset['confidence']>=0.9]\n",
    "result1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Length: 87442\n"
     ]
    }
   ],
   "source": [
    "print(\"Length:\",len(result1))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 题目2\n",
    "使用三$\\sigma$原则去除一些脏数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.04806220489604625"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sigma1 = np.std(result1['norm_pos_x'])\n",
    "sigma1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.023909596833708933"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sigma2 = np.std(result1['norm_pos_y'])\n",
    "sigma2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.40065086234862696"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mean1=np.mean(result1['norm_pos_x'])\n",
    "mean1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.4143485845880624"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mean2 = np.mean(result1['norm_pos_y'])\n",
    "mean2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>gaze_timestamp</th>\n",
       "      <th>world_index</th>\n",
       "      <th>confidence</th>\n",
       "      <th>norm_pos_x</th>\n",
       "      <th>norm_pos_y</th>\n",
       "      <th>base_data</th>\n",
       "      <th>gaze_point_3d_x</th>\n",
       "      <th>gaze_point_3d_y</th>\n",
       "      <th>gaze_point_3d_z</th>\n",
       "      <th>eye_center0_3d_x</th>\n",
       "      <th>...</th>\n",
       "      <th>eye_center0_3d_z</th>\n",
       "      <th>gaze_normal0_x</th>\n",
       "      <th>gaze_normal0_y</th>\n",
       "      <th>gaze_normal0_z</th>\n",
       "      <th>eye_center1_3d_x</th>\n",
       "      <th>eye_center1_3d_y</th>\n",
       "      <th>eye_center1_3d_z</th>\n",
       "      <th>gaze_normal1_x</th>\n",
       "      <th>gaze_normal1_y</th>\n",
       "      <th>gaze_normal1_z</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>88150.825638</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493612</td>\n",
       "      <td>0.398950</td>\n",
       "      <td>88150.827729-0 88150.823548-1</td>\n",
       "      <td>2.412810</td>\n",
       "      <td>-21.468145</td>\n",
       "      <td>-295.071057</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150041</td>\n",
       "      <td>0.234536</td>\n",
       "      <td>0.960458</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>88150.827729</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493561</td>\n",
       "      <td>0.399305</td>\n",
       "      <td>88150.827729-0 88150.827729-1</td>\n",
       "      <td>2.429837</td>\n",
       "      <td>-21.374413</td>\n",
       "      <td>-294.819200</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150243</td>\n",
       "      <td>0.234115</td>\n",
       "      <td>0.960530</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>88150.829663</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493570</td>\n",
       "      <td>0.399542</td>\n",
       "      <td>88150.827729-0 88150.83159799999-1</td>\n",
       "      <td>2.427118</td>\n",
       "      <td>-21.328193</td>\n",
       "      <td>-294.874516</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150210</td>\n",
       "      <td>0.233747</td>\n",
       "      <td>0.960624</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>88150.866015</td>\n",
       "      <td>3</td>\n",
       "      <td>0.922197</td>\n",
       "      <td>0.492592</td>\n",
       "      <td>0.398705</td>\n",
       "      <td>88150.867514-0 88150.86451599999-1</td>\n",
       "      <td>2.827911</td>\n",
       "      <td>-21.750938</td>\n",
       "      <td>-298.233245</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.060717</td>\n",
       "      <td>0.025220</td>\n",
       "      <td>0.997836</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149814</td>\n",
       "      <td>0.233510</td>\n",
       "      <td>0.960744</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>88150.869620</td>\n",
       "      <td>3</td>\n",
       "      <td>0.922197</td>\n",
       "      <td>0.492635</td>\n",
       "      <td>0.398814</td>\n",
       "      <td>88150.867514-0 88150.871726-1</td>\n",
       "      <td>2.813774</td>\n",
       "      <td>-21.744854</td>\n",
       "      <td>-298.471253</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.060717</td>\n",
       "      <td>0.025220</td>\n",
       "      <td>0.997836</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149645</td>\n",
       "      <td>0.233258</td>\n",
       "      <td>0.960831</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125259</th>\n",
       "      <td>88443.695600</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.995336</td>\n",
       "      <td>0.407831</td>\n",
       "      <td>0.413470</td>\n",
       "      <td>88443.69561-0 88443.695591-1</td>\n",
       "      <td>327.648915</td>\n",
       "      <td>-173.027524</td>\n",
       "      <td>-2777.243340</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.110854</td>\n",
       "      <td>0.041843</td>\n",
       "      <td>0.992955</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.130868</td>\n",
       "      <td>0.093021</td>\n",
       "      <td>0.987026</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125260</th>\n",
       "      <td>88443.697571</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.948733</td>\n",
       "      <td>0.407552</td>\n",
       "      <td>0.414731</td>\n",
       "      <td>88443.69561-0 88443.69953099999-1</td>\n",
       "      <td>311.054477</td>\n",
       "      <td>-161.381388</td>\n",
       "      <td>-2628.637408</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.110854</td>\n",
       "      <td>0.041843</td>\n",
       "      <td>0.992955</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.132037</td>\n",
       "      <td>0.091860</td>\n",
       "      <td>0.986979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125261</th>\n",
       "      <td>88443.701580</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407467</td>\n",
       "      <td>0.414705</td>\n",
       "      <td>88443.703629-0 88443.69953099999-1</td>\n",
       "      <td>313.566509</td>\n",
       "      <td>-162.585330</td>\n",
       "      <td>-2647.420719</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.132037</td>\n",
       "      <td>0.091860</td>\n",
       "      <td>0.986979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125262</th>\n",
       "      <td>88443.703608</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407160</td>\n",
       "      <td>0.415340</td>\n",
       "      <td>88443.703629-0 88443.703587-1</td>\n",
       "      <td>297.019831</td>\n",
       "      <td>-152.352987</td>\n",
       "      <td>-2499.428189</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.133311</td>\n",
       "      <td>0.091656</td>\n",
       "      <td>0.986827</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125263</th>\n",
       "      <td>88443.705574</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407637</td>\n",
       "      <td>0.413674</td>\n",
       "      <td>88443.703629-0 88443.70751899999-1</td>\n",
       "      <td>323.629974</td>\n",
       "      <td>-170.142461</td>\n",
       "      <td>-2737.404466</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.131320</td>\n",
       "      <td>0.092941</td>\n",
       "      <td>0.986974</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>86185 rows × 21 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        gaze_timestamp  world_index  confidence  norm_pos_x  norm_pos_y  \\\n",
       "21        88150.825638            2    0.915197    0.493612    0.398950   \n",
       "22        88150.827729            2    0.915197    0.493561    0.399305   \n",
       "23        88150.829663            2    0.915197    0.493570    0.399542   \n",
       "39        88150.866015            3    0.922197    0.492592    0.398705   \n",
       "40        88150.869620            3    0.922197    0.492635    0.398814   \n",
       "...                ...          ...         ...         ...         ...   \n",
       "125259    88443.695600         8788    0.995336    0.407831    0.413470   \n",
       "125260    88443.697571         8788    0.948733    0.407552    0.414731   \n",
       "125261    88443.701580         8788    0.945284    0.407467    0.414705   \n",
       "125262    88443.703608         8788    0.945284    0.407160    0.415340   \n",
       "125263    88443.705574         8788    0.945284    0.407637    0.413674   \n",
       "\n",
       "                                 base_data  gaze_point_3d_x  gaze_point_3d_y  \\\n",
       "21           88150.827729-0 88150.823548-1         2.412810       -21.468145   \n",
       "22           88150.827729-0 88150.827729-1         2.429837       -21.374413   \n",
       "23      88150.827729-0 88150.83159799999-1         2.427118       -21.328193   \n",
       "39      88150.867514-0 88150.86451599999-1         2.827911       -21.750938   \n",
       "40           88150.867514-0 88150.871726-1         2.813774       -21.744854   \n",
       "...                                    ...              ...              ...   \n",
       "125259        88443.69561-0 88443.695591-1       327.648915      -173.027524   \n",
       "125260   88443.69561-0 88443.69953099999-1       311.054477      -161.381388   \n",
       "125261  88443.703629-0 88443.69953099999-1       313.566509      -162.585330   \n",
       "125262       88443.703629-0 88443.703587-1       297.019831      -152.352987   \n",
       "125263  88443.703629-0 88443.70751899999-1       323.629974      -170.142461   \n",
       "\n",
       "        gaze_point_3d_z  eye_center0_3d_x  ...  eye_center0_3d_z  \\\n",
       "21          -295.071057         20.000000  ...        -20.000000   \n",
       "22          -294.819200         20.000000  ...        -20.000000   \n",
       "23          -294.874516         20.000000  ...        -20.000000   \n",
       "39          -298.233245         20.000000  ...        -20.000000   \n",
       "40          -298.471253         20.000000  ...        -20.000000   \n",
       "...                 ...               ...  ...               ...   \n",
       "125259     -2777.243340         19.888755  ...        -20.707271   \n",
       "125260     -2628.637408         19.888755  ...        -20.707271   \n",
       "125261     -2647.420719         19.888755  ...        -20.707271   \n",
       "125262     -2499.428189         19.888755  ...        -20.707271   \n",
       "125263     -2737.404466         19.888755  ...        -20.707271   \n",
       "\n",
       "        gaze_normal0_x  gaze_normal0_y  gaze_normal0_z  eye_center1_3d_x  \\\n",
       "21            0.062883        0.025100        0.997705        -39.934928   \n",
       "22            0.062883        0.025100        0.997705        -39.934928   \n",
       "23            0.062883        0.025100        0.997705        -39.934928   \n",
       "39            0.060717        0.025220        0.997836        -39.934928   \n",
       "40            0.060717        0.025220        0.997836        -39.934928   \n",
       "...                ...             ...             ...               ...   \n",
       "125259       -0.110854        0.041843        0.992955        -37.372594   \n",
       "125260       -0.110854        0.041843        0.992955        -37.372594   \n",
       "125261       -0.111009        0.041794        0.992940        -37.372594   \n",
       "125262       -0.111009        0.041794        0.992940        -37.372594   \n",
       "125263       -0.111009        0.041794        0.992940        -37.372594   \n",
       "\n",
       "        eye_center1_3d_y  eye_center1_3d_z  gaze_normal1_x  gaze_normal1_y  \\\n",
       "21             14.997919        -20.075283       -0.150041        0.234536   \n",
       "22             14.997919        -20.075283       -0.150243        0.234115   \n",
       "23             14.997919        -20.075283       -0.150210        0.233747   \n",
       "39             14.997919        -20.075283       -0.149814        0.233510   \n",
       "40             14.997919        -20.075283       -0.149645        0.233258   \n",
       "...                  ...               ...             ...             ...   \n",
       "125259         14.763454        -23.294339       -0.130868        0.093021   \n",
       "125260         14.763454        -23.294339       -0.132037        0.091860   \n",
       "125261         14.763454        -23.294339       -0.132037        0.091860   \n",
       "125262         14.763454        -23.294339       -0.133311        0.091656   \n",
       "125263         14.763454        -23.294339       -0.131320        0.092941   \n",
       "\n",
       "        gaze_normal1_z  \n",
       "21            0.960458  \n",
       "22            0.960530  \n",
       "23            0.960624  \n",
       "39            0.960744  \n",
       "40            0.960831  \n",
       "...                ...  \n",
       "125259        0.987026  \n",
       "125260        0.986979  \n",
       "125261        0.986979  \n",
       "125262        0.986827  \n",
       "125263        0.986974  \n",
       "\n",
       "[86185 rows x 21 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result2 = result1.loc[(result1['norm_pos_x']>=mean1-3*sigma1)&(result1['norm_pos_x']<=mean1+3*sigma1)&(result1['norm_pos_y']>=mean2-3*sigma2)&(result1['norm_pos_y']<=mean2+3*sigma2)]\n",
    "result2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 题目3\n",
    "转换unix时间为人类可读"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "result3 = result2.copy(deep=True)#拷贝一个题目2结果的副本"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 转换函数\n",
    "使用datetime模块"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "result3[\"gaze_timestamp\"] = pd.to_datetime(result3[\"gaze_timestamp\"].values,unit = \"s\",utc=True).tz_convert(\"Asia/Shanghai\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>gaze_timestamp</th>\n",
       "      <th>world_index</th>\n",
       "      <th>confidence</th>\n",
       "      <th>norm_pos_x</th>\n",
       "      <th>norm_pos_y</th>\n",
       "      <th>base_data</th>\n",
       "      <th>gaze_point_3d_x</th>\n",
       "      <th>gaze_point_3d_y</th>\n",
       "      <th>gaze_point_3d_z</th>\n",
       "      <th>eye_center0_3d_x</th>\n",
       "      <th>...</th>\n",
       "      <th>eye_center0_3d_z</th>\n",
       "      <th>gaze_normal0_x</th>\n",
       "      <th>gaze_normal0_y</th>\n",
       "      <th>gaze_normal0_z</th>\n",
       "      <th>eye_center1_3d_x</th>\n",
       "      <th>eye_center1_3d_y</th>\n",
       "      <th>eye_center1_3d_z</th>\n",
       "      <th>gaze_normal1_x</th>\n",
       "      <th>gaze_normal1_y</th>\n",
       "      <th>gaze_normal1_z</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>1970-01-02 08:29:10.825638500+08:00</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493612</td>\n",
       "      <td>0.398950</td>\n",
       "      <td>88150.827729-0 88150.823548-1</td>\n",
       "      <td>2.412810</td>\n",
       "      <td>-21.468145</td>\n",
       "      <td>-295.071057</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150041</td>\n",
       "      <td>0.234536</td>\n",
       "      <td>0.960458</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>1970-01-02 08:29:10.827729+08:00</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493561</td>\n",
       "      <td>0.399305</td>\n",
       "      <td>88150.827729-0 88150.827729-1</td>\n",
       "      <td>2.429837</td>\n",
       "      <td>-21.374413</td>\n",
       "      <td>-294.819200</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150243</td>\n",
       "      <td>0.234115</td>\n",
       "      <td>0.960530</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>1970-01-02 08:29:10.829663500+08:00</td>\n",
       "      <td>2</td>\n",
       "      <td>0.915197</td>\n",
       "      <td>0.493570</td>\n",
       "      <td>0.399542</td>\n",
       "      <td>88150.827729-0 88150.83159799999-1</td>\n",
       "      <td>2.427118</td>\n",
       "      <td>-21.328193</td>\n",
       "      <td>-294.874516</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062883</td>\n",
       "      <td>0.025100</td>\n",
       "      <td>0.997705</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150210</td>\n",
       "      <td>0.233747</td>\n",
       "      <td>0.960624</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>1970-01-02 08:29:10.866015+08:00</td>\n",
       "      <td>3</td>\n",
       "      <td>0.922197</td>\n",
       "      <td>0.492592</td>\n",
       "      <td>0.398705</td>\n",
       "      <td>88150.867514-0 88150.86451599999-1</td>\n",
       "      <td>2.827911</td>\n",
       "      <td>-21.750938</td>\n",
       "      <td>-298.233245</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.060717</td>\n",
       "      <td>0.025220</td>\n",
       "      <td>0.997836</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149814</td>\n",
       "      <td>0.233510</td>\n",
       "      <td>0.960744</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>1970-01-02 08:29:10.869620+08:00</td>\n",
       "      <td>3</td>\n",
       "      <td>0.922197</td>\n",
       "      <td>0.492635</td>\n",
       "      <td>0.398814</td>\n",
       "      <td>88150.867514-0 88150.871726-1</td>\n",
       "      <td>2.813774</td>\n",
       "      <td>-21.744854</td>\n",
       "      <td>-298.471253</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.060717</td>\n",
       "      <td>0.025220</td>\n",
       "      <td>0.997836</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149645</td>\n",
       "      <td>0.233258</td>\n",
       "      <td>0.960831</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125259</th>\n",
       "      <td>1970-01-02 08:34:03.695600500+08:00</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.995336</td>\n",
       "      <td>0.407831</td>\n",
       "      <td>0.413470</td>\n",
       "      <td>88443.69561-0 88443.695591-1</td>\n",
       "      <td>327.648915</td>\n",
       "      <td>-173.027524</td>\n",
       "      <td>-2777.243340</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.110854</td>\n",
       "      <td>0.041843</td>\n",
       "      <td>0.992955</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.130868</td>\n",
       "      <td>0.093021</td>\n",
       "      <td>0.987026</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125260</th>\n",
       "      <td>1970-01-02 08:34:03.697570500+08:00</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.948733</td>\n",
       "      <td>0.407552</td>\n",
       "      <td>0.414731</td>\n",
       "      <td>88443.69561-0 88443.69953099999-1</td>\n",
       "      <td>311.054477</td>\n",
       "      <td>-161.381388</td>\n",
       "      <td>-2628.637408</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.110854</td>\n",
       "      <td>0.041843</td>\n",
       "      <td>0.992955</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.132037</td>\n",
       "      <td>0.091860</td>\n",
       "      <td>0.986979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125261</th>\n",
       "      <td>1970-01-02 08:34:03.701580+08:00</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407467</td>\n",
       "      <td>0.414705</td>\n",
       "      <td>88443.703629-0 88443.69953099999-1</td>\n",
       "      <td>313.566509</td>\n",
       "      <td>-162.585330</td>\n",
       "      <td>-2647.420719</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.132037</td>\n",
       "      <td>0.091860</td>\n",
       "      <td>0.986979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125262</th>\n",
       "      <td>1970-01-02 08:34:03.703608+08:00</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407160</td>\n",
       "      <td>0.415340</td>\n",
       "      <td>88443.703629-0 88443.703587-1</td>\n",
       "      <td>297.019831</td>\n",
       "      <td>-152.352987</td>\n",
       "      <td>-2499.428189</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.133311</td>\n",
       "      <td>0.091656</td>\n",
       "      <td>0.986827</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125263</th>\n",
       "      <td>1970-01-02 08:34:03.705574+08:00</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407637</td>\n",
       "      <td>0.413674</td>\n",
       "      <td>88443.703629-0 88443.70751899999-1</td>\n",
       "      <td>323.629974</td>\n",
       "      <td>-170.142461</td>\n",
       "      <td>-2737.404466</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.131320</td>\n",
       "      <td>0.092941</td>\n",
       "      <td>0.986974</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>86185 rows × 21 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                            gaze_timestamp  world_index  confidence  \\\n",
       "21     1970-01-02 08:29:10.825638500+08:00            2    0.915197   \n",
       "22        1970-01-02 08:29:10.827729+08:00            2    0.915197   \n",
       "23     1970-01-02 08:29:10.829663500+08:00            2    0.915197   \n",
       "39        1970-01-02 08:29:10.866015+08:00            3    0.922197   \n",
       "40        1970-01-02 08:29:10.869620+08:00            3    0.922197   \n",
       "...                                    ...          ...         ...   \n",
       "125259 1970-01-02 08:34:03.695600500+08:00         8788    0.995336   \n",
       "125260 1970-01-02 08:34:03.697570500+08:00         8788    0.948733   \n",
       "125261    1970-01-02 08:34:03.701580+08:00         8788    0.945284   \n",
       "125262    1970-01-02 08:34:03.703608+08:00         8788    0.945284   \n",
       "125263    1970-01-02 08:34:03.705574+08:00         8788    0.945284   \n",
       "\n",
       "        norm_pos_x  norm_pos_y                           base_data  \\\n",
       "21        0.493612    0.398950       88150.827729-0 88150.823548-1   \n",
       "22        0.493561    0.399305       88150.827729-0 88150.827729-1   \n",
       "23        0.493570    0.399542  88150.827729-0 88150.83159799999-1   \n",
       "39        0.492592    0.398705  88150.867514-0 88150.86451599999-1   \n",
       "40        0.492635    0.398814       88150.867514-0 88150.871726-1   \n",
       "...            ...         ...                                 ...   \n",
       "125259    0.407831    0.413470        88443.69561-0 88443.695591-1   \n",
       "125260    0.407552    0.414731   88443.69561-0 88443.69953099999-1   \n",
       "125261    0.407467    0.414705  88443.703629-0 88443.69953099999-1   \n",
       "125262    0.407160    0.415340       88443.703629-0 88443.703587-1   \n",
       "125263    0.407637    0.413674  88443.703629-0 88443.70751899999-1   \n",
       "\n",
       "        gaze_point_3d_x  gaze_point_3d_y  gaze_point_3d_z  eye_center0_3d_x  \\\n",
       "21             2.412810       -21.468145      -295.071057         20.000000   \n",
       "22             2.429837       -21.374413      -294.819200         20.000000   \n",
       "23             2.427118       -21.328193      -294.874516         20.000000   \n",
       "39             2.827911       -21.750938      -298.233245         20.000000   \n",
       "40             2.813774       -21.744854      -298.471253         20.000000   \n",
       "...                 ...              ...              ...               ...   \n",
       "125259       327.648915      -173.027524     -2777.243340         19.888755   \n",
       "125260       311.054477      -161.381388     -2628.637408         19.888755   \n",
       "125261       313.566509      -162.585330     -2647.420719         19.888755   \n",
       "125262       297.019831      -152.352987     -2499.428189         19.888755   \n",
       "125263       323.629974      -170.142461     -2737.404466         19.888755   \n",
       "\n",
       "        ...  eye_center0_3d_z  gaze_normal0_x  gaze_normal0_y  gaze_normal0_z  \\\n",
       "21      ...        -20.000000        0.062883        0.025100        0.997705   \n",
       "22      ...        -20.000000        0.062883        0.025100        0.997705   \n",
       "23      ...        -20.000000        0.062883        0.025100        0.997705   \n",
       "39      ...        -20.000000        0.060717        0.025220        0.997836   \n",
       "40      ...        -20.000000        0.060717        0.025220        0.997836   \n",
       "...     ...               ...             ...             ...             ...   \n",
       "125259  ...        -20.707271       -0.110854        0.041843        0.992955   \n",
       "125260  ...        -20.707271       -0.110854        0.041843        0.992955   \n",
       "125261  ...        -20.707271       -0.111009        0.041794        0.992940   \n",
       "125262  ...        -20.707271       -0.111009        0.041794        0.992940   \n",
       "125263  ...        -20.707271       -0.111009        0.041794        0.992940   \n",
       "\n",
       "        eye_center1_3d_x  eye_center1_3d_y  eye_center1_3d_z  gaze_normal1_x  \\\n",
       "21            -39.934928         14.997919        -20.075283       -0.150041   \n",
       "22            -39.934928         14.997919        -20.075283       -0.150243   \n",
       "23            -39.934928         14.997919        -20.075283       -0.150210   \n",
       "39            -39.934928         14.997919        -20.075283       -0.149814   \n",
       "40            -39.934928         14.997919        -20.075283       -0.149645   \n",
       "...                  ...               ...               ...             ...   \n",
       "125259        -37.372594         14.763454        -23.294339       -0.130868   \n",
       "125260        -37.372594         14.763454        -23.294339       -0.132037   \n",
       "125261        -37.372594         14.763454        -23.294339       -0.132037   \n",
       "125262        -37.372594         14.763454        -23.294339       -0.133311   \n",
       "125263        -37.372594         14.763454        -23.294339       -0.131320   \n",
       "\n",
       "        gaze_normal1_y  gaze_normal1_z  \n",
       "21            0.234536        0.960458  \n",
       "22            0.234115        0.960530  \n",
       "23            0.233747        0.960624  \n",
       "39            0.233510        0.960744  \n",
       "40            0.233258        0.960831  \n",
       "...                ...             ...  \n",
       "125259        0.093021        0.987026  \n",
       "125260        0.091860        0.986979  \n",
       "125261        0.091860        0.986979  \n",
       "125262        0.091656        0.986827  \n",
       "125263        0.092941        0.986974  \n",
       "\n",
       "[86185 rows x 21 columns]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result3"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 题目4 计算取样频率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "result4 = dataset.sort_values(\"gaze_timestamp\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>gaze_timestamp</th>\n",
       "      <th>world_index</th>\n",
       "      <th>confidence</th>\n",
       "      <th>norm_pos_x</th>\n",
       "      <th>norm_pos_y</th>\n",
       "      <th>base_data</th>\n",
       "      <th>gaze_point_3d_x</th>\n",
       "      <th>gaze_point_3d_y</th>\n",
       "      <th>gaze_point_3d_z</th>\n",
       "      <th>eye_center0_3d_x</th>\n",
       "      <th>...</th>\n",
       "      <th>eye_center0_3d_z</th>\n",
       "      <th>gaze_normal0_x</th>\n",
       "      <th>gaze_normal0_y</th>\n",
       "      <th>gaze_normal0_z</th>\n",
       "      <th>eye_center1_3d_x</th>\n",
       "      <th>eye_center1_3d_y</th>\n",
       "      <th>eye_center1_3d_z</th>\n",
       "      <th>gaze_normal1_x</th>\n",
       "      <th>gaze_normal1_y</th>\n",
       "      <th>gaze_normal1_z</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>88150.776780</td>\n",
       "      <td>0</td>\n",
       "      <td>0.828006</td>\n",
       "      <td>0.531433</td>\n",
       "      <td>0.397509</td>\n",
       "      <td>88150.77678-0</td>\n",
       "      <td>28.369753</td>\n",
       "      <td>52.033135</td>\n",
       "      <td>705.121116</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.011527</td>\n",
       "      <td>0.051002</td>\n",
       "      <td>0.998632</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>88150.776787</td>\n",
       "      <td>0</td>\n",
       "      <td>0.459705</td>\n",
       "      <td>0.337051</td>\n",
       "      <td>0.186147</td>\n",
       "      <td>88150.776787-1</td>\n",
       "      <td>-142.869866</td>\n",
       "      <td>154.788121</td>\n",
       "      <td>684.981621</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.141761</td>\n",
       "      <td>0.192518</td>\n",
       "      <td>0.971000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>88150.779709</td>\n",
       "      <td>0</td>\n",
       "      <td>0.888789</td>\n",
       "      <td>0.543140</td>\n",
       "      <td>0.410668</td>\n",
       "      <td>88150.779709-0</td>\n",
       "      <td>38.942051</td>\n",
       "      <td>45.359863</td>\n",
       "      <td>705.232112</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.026087</td>\n",
       "      <td>0.041811</td>\n",
       "      <td>0.998785</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>88150.779759</td>\n",
       "      <td>0</td>\n",
       "      <td>0.550258</td>\n",
       "      <td>0.337923</td>\n",
       "      <td>0.173301</td>\n",
       "      <td>88150.779759-1</td>\n",
       "      <td>-141.879169</td>\n",
       "      <td>160.867779</td>\n",
       "      <td>683.893108</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.140397</td>\n",
       "      <td>0.200891</td>\n",
       "      <td>0.969501</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>88150.787485</td>\n",
       "      <td>1</td>\n",
       "      <td>0.502595</td>\n",
       "      <td>0.340109</td>\n",
       "      <td>0.142989</td>\n",
       "      <td>88150.787485-1</td>\n",
       "      <td>-139.404860</td>\n",
       "      <td>175.088321</td>\n",
       "      <td>681.151453</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.136989</td>\n",
       "      <td>0.220475</td>\n",
       "      <td>0.965725</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125259</th>\n",
       "      <td>88443.695600</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.995336</td>\n",
       "      <td>0.407831</td>\n",
       "      <td>0.413470</td>\n",
       "      <td>88443.69561-0 88443.695591-1</td>\n",
       "      <td>327.648915</td>\n",
       "      <td>-173.027524</td>\n",
       "      <td>-2777.243340</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.110854</td>\n",
       "      <td>0.041843</td>\n",
       "      <td>0.992955</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.130868</td>\n",
       "      <td>0.093021</td>\n",
       "      <td>0.987026</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125260</th>\n",
       "      <td>88443.697571</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.948733</td>\n",
       "      <td>0.407552</td>\n",
       "      <td>0.414731</td>\n",
       "      <td>88443.69561-0 88443.69953099999-1</td>\n",
       "      <td>311.054477</td>\n",
       "      <td>-161.381388</td>\n",
       "      <td>-2628.637408</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.110854</td>\n",
       "      <td>0.041843</td>\n",
       "      <td>0.992955</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.132037</td>\n",
       "      <td>0.091860</td>\n",
       "      <td>0.986979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125261</th>\n",
       "      <td>88443.701580</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407467</td>\n",
       "      <td>0.414705</td>\n",
       "      <td>88443.703629-0 88443.69953099999-1</td>\n",
       "      <td>313.566509</td>\n",
       "      <td>-162.585330</td>\n",
       "      <td>-2647.420719</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.132037</td>\n",
       "      <td>0.091860</td>\n",
       "      <td>0.986979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125262</th>\n",
       "      <td>88443.703608</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407160</td>\n",
       "      <td>0.415340</td>\n",
       "      <td>88443.703629-0 88443.703587-1</td>\n",
       "      <td>297.019831</td>\n",
       "      <td>-152.352987</td>\n",
       "      <td>-2499.428189</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.133311</td>\n",
       "      <td>0.091656</td>\n",
       "      <td>0.986827</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125263</th>\n",
       "      <td>88443.705574</td>\n",
       "      <td>8788</td>\n",
       "      <td>0.945284</td>\n",
       "      <td>0.407637</td>\n",
       "      <td>0.413674</td>\n",
       "      <td>88443.703629-0 88443.70751899999-1</td>\n",
       "      <td>323.629974</td>\n",
       "      <td>-170.142461</td>\n",
       "      <td>-2737.404466</td>\n",
       "      <td>19.888755</td>\n",
       "      <td>...</td>\n",
       "      <td>-20.707271</td>\n",
       "      <td>-0.111009</td>\n",
       "      <td>0.041794</td>\n",
       "      <td>0.992940</td>\n",
       "      <td>-37.372594</td>\n",
       "      <td>14.763454</td>\n",
       "      <td>-23.294339</td>\n",
       "      <td>-0.131320</td>\n",
       "      <td>0.092941</td>\n",
       "      <td>0.986974</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>125264 rows × 21 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        gaze_timestamp  world_index  confidence  norm_pos_x  norm_pos_y  \\\n",
       "0         88150.776780            0    0.828006    0.531433    0.397509   \n",
       "1         88150.776787            0    0.459705    0.337051    0.186147   \n",
       "2         88150.779709            0    0.888789    0.543140    0.410668   \n",
       "3         88150.779759            0    0.550258    0.337923    0.173301   \n",
       "4         88150.787485            1    0.502595    0.340109    0.142989   \n",
       "...                ...          ...         ...         ...         ...   \n",
       "125259    88443.695600         8788    0.995336    0.407831    0.413470   \n",
       "125260    88443.697571         8788    0.948733    0.407552    0.414731   \n",
       "125261    88443.701580         8788    0.945284    0.407467    0.414705   \n",
       "125262    88443.703608         8788    0.945284    0.407160    0.415340   \n",
       "125263    88443.705574         8788    0.945284    0.407637    0.413674   \n",
       "\n",
       "                                 base_data  gaze_point_3d_x  gaze_point_3d_y  \\\n",
       "0                            88150.77678-0        28.369753        52.033135   \n",
       "1                           88150.776787-1      -142.869866       154.788121   \n",
       "2                           88150.779709-0        38.942051        45.359863   \n",
       "3                           88150.779759-1      -141.879169       160.867779   \n",
       "4                           88150.787485-1      -139.404860       175.088321   \n",
       "...                                    ...              ...              ...   \n",
       "125259        88443.69561-0 88443.695591-1       327.648915      -173.027524   \n",
       "125260   88443.69561-0 88443.69953099999-1       311.054477      -161.381388   \n",
       "125261  88443.703629-0 88443.69953099999-1       313.566509      -162.585330   \n",
       "125262       88443.703629-0 88443.703587-1       297.019831      -152.352987   \n",
       "125263  88443.703629-0 88443.70751899999-1       323.629974      -170.142461   \n",
       "\n",
       "        gaze_point_3d_z  eye_center0_3d_x  ...  eye_center0_3d_z  \\\n",
       "0            705.121116         20.000000  ...        -20.000000   \n",
       "1            684.981621        -39.934928  ...        -20.075283   \n",
       "2            705.232112         20.000000  ...        -20.000000   \n",
       "3            683.893108        -39.934928  ...        -20.075283   \n",
       "4            681.151453        -39.934928  ...        -20.075283   \n",
       "...                 ...               ...  ...               ...   \n",
       "125259     -2777.243340         19.888755  ...        -20.707271   \n",
       "125260     -2628.637408         19.888755  ...        -20.707271   \n",
       "125261     -2647.420719         19.888755  ...        -20.707271   \n",
       "125262     -2499.428189         19.888755  ...        -20.707271   \n",
       "125263     -2737.404466         19.888755  ...        -20.707271   \n",
       "\n",
       "        gaze_normal0_x  gaze_normal0_y  gaze_normal0_z  eye_center1_3d_x  \\\n",
       "0             0.011527        0.051002        0.998632               NaN   \n",
       "1            -0.141761        0.192518        0.971000               NaN   \n",
       "2             0.026087        0.041811        0.998785               NaN   \n",
       "3            -0.140397        0.200891        0.969501               NaN   \n",
       "4            -0.136989        0.220475        0.965725               NaN   \n",
       "...                ...             ...             ...               ...   \n",
       "125259       -0.110854        0.041843        0.992955        -37.372594   \n",
       "125260       -0.110854        0.041843        0.992955        -37.372594   \n",
       "125261       -0.111009        0.041794        0.992940        -37.372594   \n",
       "125262       -0.111009        0.041794        0.992940        -37.372594   \n",
       "125263       -0.111009        0.041794        0.992940        -37.372594   \n",
       "\n",
       "        eye_center1_3d_y  eye_center1_3d_z  gaze_normal1_x  gaze_normal1_y  \\\n",
       "0                    NaN               NaN             NaN             NaN   \n",
       "1                    NaN               NaN             NaN             NaN   \n",
       "2                    NaN               NaN             NaN             NaN   \n",
       "3                    NaN               NaN             NaN             NaN   \n",
       "4                    NaN               NaN             NaN             NaN   \n",
       "...                  ...               ...             ...             ...   \n",
       "125259         14.763454        -23.294339       -0.130868        0.093021   \n",
       "125260         14.763454        -23.294339       -0.132037        0.091860   \n",
       "125261         14.763454        -23.294339       -0.132037        0.091860   \n",
       "125262         14.763454        -23.294339       -0.133311        0.091656   \n",
       "125263         14.763454        -23.294339       -0.131320        0.092941   \n",
       "\n",
       "        gaze_normal1_z  \n",
       "0                  NaN  \n",
       "1                  NaN  \n",
       "2                  NaN  \n",
       "3                  NaN  \n",
       "4                  NaN  \n",
       "...                ...  \n",
       "125259        0.987026  \n",
       "125260        0.986979  \n",
       "125261        0.986979  \n",
       "125262        0.986827  \n",
       "125263        0.986974  \n",
       "\n",
       "[125264 rows x 21 columns]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "startIndex=result4.index[0]\n",
    "endIndex=result4.index[-1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "start time: 88150.77678\n",
      "end time:   88443.70557399998\n"
     ]
    }
   ],
   "source": [
    "print(\"start time:\",dataset['gaze_timestamp'][startIndex])\n",
    "print(\"end time:  \",dataset['gaze_timestamp'][endIndex])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "Timerange = dataset[\"gaze_timestamp\"][endIndex]-dataset[\"gaze_timestamp\"][startIndex]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "频率为： 427.6261076608589 Hz\n"
     ]
    }
   ],
   "source": [
    "print(\"频率为：\",1/(Timerange/len(dataset['gaze_timestamp'])),\"Hz\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 题目五\n",
    "重采样"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "data5 = dataset.copy(deep=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "data5[\"gaze_timestamp\"] = pd.to_datetime(data5[\"gaze_timestamp\"].values,unit = \"s\",utc=True).tz_convert(\"Asia/Shanghai\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "data5=data5.resample(\"0.01S\",on = \"gaze_timestamp\").mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>world_index</th>\n",
       "      <th>confidence</th>\n",
       "      <th>norm_pos_x</th>\n",
       "      <th>norm_pos_y</th>\n",
       "      <th>gaze_point_3d_x</th>\n",
       "      <th>gaze_point_3d_y</th>\n",
       "      <th>gaze_point_3d_z</th>\n",
       "      <th>eye_center0_3d_x</th>\n",
       "      <th>eye_center0_3d_y</th>\n",
       "      <th>eye_center0_3d_z</th>\n",
       "      <th>gaze_normal0_x</th>\n",
       "      <th>gaze_normal0_y</th>\n",
       "      <th>gaze_normal0_z</th>\n",
       "      <th>eye_center1_3d_x</th>\n",
       "      <th>eye_center1_3d_y</th>\n",
       "      <th>eye_center1_3d_z</th>\n",
       "      <th>gaze_normal1_x</th>\n",
       "      <th>gaze_normal1_y</th>\n",
       "      <th>gaze_normal1_z</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>gaze_timestamp</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1970-01-02 08:29:10.770000+08:00</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.681690</td>\n",
       "      <td>0.437387</td>\n",
       "      <td>0.291906</td>\n",
       "      <td>-54.359308</td>\n",
       "      <td>103.262224</td>\n",
       "      <td>694.806989</td>\n",
       "      <td>-9.967464</td>\n",
       "      <td>14.998960</td>\n",
       "      <td>-20.037641</td>\n",
       "      <td>-0.061136</td>\n",
       "      <td>0.121556</td>\n",
       "      <td>0.984479</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1970-01-02 08:29:10.780000+08:00</th>\n",
       "      <td>1.0</td>\n",
       "      <td>0.584288</td>\n",
       "      <td>0.437978</td>\n",
       "      <td>0.307110</td>\n",
       "      <td>-42.813406</td>\n",
       "      <td>41.035419</td>\n",
       "      <td>10.103229</td>\n",
       "      <td>0.021691</td>\n",
       "      <td>14.999306</td>\n",
       "      <td>-20.025094</td>\n",
       "      <td>-0.014355</td>\n",
       "      <td>0.095046</td>\n",
       "      <td>0.987478</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.145087</td>\n",
       "      <td>0.230744</td>\n",
       "      <td>0.962137</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1970-01-02 08:29:10.790000+08:00</th>\n",
       "      <td>1.0</td>\n",
       "      <td>0.679988</td>\n",
       "      <td>0.494694</td>\n",
       "      <td>0.404853</td>\n",
       "      <td>1.979829</td>\n",
       "      <td>-20.040517</td>\n",
       "      <td>-292.334754</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.065145</td>\n",
       "      <td>0.027374</td>\n",
       "      <td>0.997500</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150232</td>\n",
       "      <td>0.224797</td>\n",
       "      <td>0.962738</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1970-01-02 08:29:10.800000+08:00</th>\n",
       "      <td>1.0</td>\n",
       "      <td>0.810370</td>\n",
       "      <td>0.494951</td>\n",
       "      <td>0.404822</td>\n",
       "      <td>1.859581</td>\n",
       "      <td>-19.717564</td>\n",
       "      <td>-287.721641</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.066672</td>\n",
       "      <td>0.024890</td>\n",
       "      <td>0.997463</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.152198</td>\n",
       "      <td>0.229156</td>\n",
       "      <td>0.961410</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1970-01-02 08:29:10.810000+08:00</th>\n",
       "      <td>2.0</td>\n",
       "      <td>0.811268</td>\n",
       "      <td>0.494067</td>\n",
       "      <td>0.401053</td>\n",
       "      <td>2.204797</td>\n",
       "      <td>-20.676414</td>\n",
       "      <td>-290.218427</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.064772</td>\n",
       "      <td>0.024500</td>\n",
       "      <td>0.997599</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.151952</td>\n",
       "      <td>0.234021</td>\n",
       "      <td>0.960284</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1970-01-02 08:29:10.820000+08:00</th>\n",
       "      <td>2.0</td>\n",
       "      <td>0.893564</td>\n",
       "      <td>0.493605</td>\n",
       "      <td>0.399335</td>\n",
       "      <td>2.409602</td>\n",
       "      <td>-21.335674</td>\n",
       "      <td>-294.369777</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.063058</td>\n",
       "      <td>0.025140</td>\n",
       "      <td>0.997693</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150413</td>\n",
       "      <td>0.234215</td>\n",
       "      <td>0.960478</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1970-01-02 08:29:10.830000+08:00</th>\n",
       "      <td>2.0</td>\n",
       "      <td>0.845289</td>\n",
       "      <td>0.493316</td>\n",
       "      <td>0.398559</td>\n",
       "      <td>2.512630</td>\n",
       "      <td>-21.451642</td>\n",
       "      <td>-293.704395</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.062845</td>\n",
       "      <td>0.027284</td>\n",
       "      <td>0.997650</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.151138</td>\n",
       "      <td>0.233532</td>\n",
       "      <td>0.960531</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1970-01-02 08:29:10.840000+08:00</th>\n",
       "      <td>2.5</td>\n",
       "      <td>0.841835</td>\n",
       "      <td>0.492696</td>\n",
       "      <td>0.398804</td>\n",
       "      <td>2.767211</td>\n",
       "      <td>-21.566487</td>\n",
       "      <td>-295.993985</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.061422</td>\n",
       "      <td>0.025921</td>\n",
       "      <td>0.997775</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150791</td>\n",
       "      <td>0.233569</td>\n",
       "      <td>0.960577</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1970-01-02 08:29:10.850000+08:00</th>\n",
       "      <td>3.0</td>\n",
       "      <td>0.813601</td>\n",
       "      <td>0.492874</td>\n",
       "      <td>0.398257</td>\n",
       "      <td>2.711425</td>\n",
       "      <td>-21.777256</td>\n",
       "      <td>-297.274745</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.061335</td>\n",
       "      <td>0.026011</td>\n",
       "      <td>0.997778</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149916</td>\n",
       "      <td>0.233780</td>\n",
       "      <td>0.960662</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1970-01-02 08:29:10.860000+08:00</th>\n",
       "      <td>3.0</td>\n",
       "      <td>0.893743</td>\n",
       "      <td>0.492674</td>\n",
       "      <td>0.398524</td>\n",
       "      <td>2.798286</td>\n",
       "      <td>-21.804480</td>\n",
       "      <td>-298.433361</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.060777</td>\n",
       "      <td>0.025339</td>\n",
       "      <td>0.997830</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149606</td>\n",
       "      <td>0.233583</td>\n",
       "      <td>0.960758</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1970-01-02 08:29:10.870000+08:00</th>\n",
       "      <td>3.5</td>\n",
       "      <td>0.862389</td>\n",
       "      <td>0.492139</td>\n",
       "      <td>0.398724</td>\n",
       "      <td>3.005405</td>\n",
       "      <td>-21.779999</td>\n",
       "      <td>-298.687614</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.059995</td>\n",
       "      <td>0.025130</td>\n",
       "      <td>0.997882</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.150185</td>\n",
       "      <td>0.233384</td>\n",
       "      <td>0.960716</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1970-01-02 08:29:10.880000+08:00</th>\n",
       "      <td>4.0</td>\n",
       "      <td>0.892706</td>\n",
       "      <td>0.492170</td>\n",
       "      <td>0.398582</td>\n",
       "      <td>3.002544</td>\n",
       "      <td>-21.876653</td>\n",
       "      <td>-299.589471</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.059813</td>\n",
       "      <td>0.025071</td>\n",
       "      <td>0.997894</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149704</td>\n",
       "      <td>0.233300</td>\n",
       "      <td>0.960812</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1970-01-02 08:29:10.890000+08:00</th>\n",
       "      <td>4.0</td>\n",
       "      <td>0.863562</td>\n",
       "      <td>0.491619</td>\n",
       "      <td>0.398328</td>\n",
       "      <td>3.227031</td>\n",
       "      <td>-22.022033</td>\n",
       "      <td>-300.826326</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.058765</td>\n",
       "      <td>0.024700</td>\n",
       "      <td>0.997966</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149820</td>\n",
       "      <td>0.233547</td>\n",
       "      <td>0.960734</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1970-01-02 08:29:10.900000+08:00</th>\n",
       "      <td>4.0</td>\n",
       "      <td>0.850346</td>\n",
       "      <td>0.491440</td>\n",
       "      <td>0.398221</td>\n",
       "      <td>3.300165</td>\n",
       "      <td>-22.075103</td>\n",
       "      <td>-301.234553</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.058422</td>\n",
       "      <td>0.024264</td>\n",
       "      <td>0.997997</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149847</td>\n",
       "      <td>0.233968</td>\n",
       "      <td>0.960627</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1970-01-02 08:29:10.910000+08:00</th>\n",
       "      <td>5.0</td>\n",
       "      <td>0.878314</td>\n",
       "      <td>0.491522</td>\n",
       "      <td>0.397330</td>\n",
       "      <td>3.278969</td>\n",
       "      <td>-22.336895</td>\n",
       "      <td>-302.166428</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.058302</td>\n",
       "      <td>0.025038</td>\n",
       "      <td>0.997985</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.149284</td>\n",
       "      <td>0.234162</td>\n",
       "      <td>0.960668</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1970-01-02 08:29:10.920000+08:00</th>\n",
       "      <td>5.0</td>\n",
       "      <td>0.864336</td>\n",
       "      <td>0.491490</td>\n",
       "      <td>0.396538</td>\n",
       "      <td>3.308013</td>\n",
       "      <td>-22.621279</td>\n",
       "      <td>-303.673027</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.057891</td>\n",
       "      <td>0.025402</td>\n",
       "      <td>0.997999</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.148602</td>\n",
       "      <td>0.234394</td>\n",
       "      <td>0.960717</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1970-01-02 08:29:10.930000+08:00</th>\n",
       "      <td>5.0</td>\n",
       "      <td>0.998242</td>\n",
       "      <td>0.491106</td>\n",
       "      <td>0.396239</td>\n",
       "      <td>3.462726</td>\n",
       "      <td>-22.723509</td>\n",
       "      <td>-304.165507</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.057256</td>\n",
       "      <td>0.025568</td>\n",
       "      <td>0.998032</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.148867</td>\n",
       "      <td>0.234479</td>\n",
       "      <td>0.960655</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1970-01-02 08:29:10.940000+08:00</th>\n",
       "      <td>5.6</td>\n",
       "      <td>0.822405</td>\n",
       "      <td>0.491349</td>\n",
       "      <td>0.396675</td>\n",
       "      <td>3.365049</td>\n",
       "      <td>-22.609107</td>\n",
       "      <td>-303.908032</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.057648</td>\n",
       "      <td>0.025339</td>\n",
       "      <td>0.998015</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.148678</td>\n",
       "      <td>0.234164</td>\n",
       "      <td>0.960761</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1970-01-02 08:29:10.950000+08:00</th>\n",
       "      <td>6.0</td>\n",
       "      <td>0.837220</td>\n",
       "      <td>0.491234</td>\n",
       "      <td>0.397143</td>\n",
       "      <td>3.410404</td>\n",
       "      <td>-22.507586</td>\n",
       "      <td>-303.923452</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.057488</td>\n",
       "      <td>0.024511</td>\n",
       "      <td>0.998045</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.148821</td>\n",
       "      <td>0.234277</td>\n",
       "      <td>0.960712</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1970-01-02 08:29:10.960000+08:00</th>\n",
       "      <td>6.0</td>\n",
       "      <td>0.860573</td>\n",
       "      <td>0.490922</td>\n",
       "      <td>0.397230</td>\n",
       "      <td>3.540623</td>\n",
       "      <td>-22.548167</td>\n",
       "      <td>-304.725183</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>-20.000000</td>\n",
       "      <td>0.056879</td>\n",
       "      <td>0.024088</td>\n",
       "      <td>0.998090</td>\n",
       "      <td>-39.934928</td>\n",
       "      <td>14.997919</td>\n",
       "      <td>-20.075283</td>\n",
       "      <td>-0.148850</td>\n",
       "      <td>0.234256</td>\n",
       "      <td>0.960712</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                  world_index  confidence  norm_pos_x  \\\n",
       "gaze_timestamp                                                          \n",
       "1970-01-02 08:29:10.770000+08:00          0.0    0.681690    0.437387   \n",
       "1970-01-02 08:29:10.780000+08:00          1.0    0.584288    0.437978   \n",
       "1970-01-02 08:29:10.790000+08:00          1.0    0.679988    0.494694   \n",
       "1970-01-02 08:29:10.800000+08:00          1.0    0.810370    0.494951   \n",
       "1970-01-02 08:29:10.810000+08:00          2.0    0.811268    0.494067   \n",
       "1970-01-02 08:29:10.820000+08:00          2.0    0.893564    0.493605   \n",
       "1970-01-02 08:29:10.830000+08:00          2.0    0.845289    0.493316   \n",
       "1970-01-02 08:29:10.840000+08:00          2.5    0.841835    0.492696   \n",
       "1970-01-02 08:29:10.850000+08:00          3.0    0.813601    0.492874   \n",
       "1970-01-02 08:29:10.860000+08:00          3.0    0.893743    0.492674   \n",
       "1970-01-02 08:29:10.870000+08:00          3.5    0.862389    0.492139   \n",
       "1970-01-02 08:29:10.880000+08:00          4.0    0.892706    0.492170   \n",
       "1970-01-02 08:29:10.890000+08:00          4.0    0.863562    0.491619   \n",
       "1970-01-02 08:29:10.900000+08:00          4.0    0.850346    0.491440   \n",
       "1970-01-02 08:29:10.910000+08:00          5.0    0.878314    0.491522   \n",
       "1970-01-02 08:29:10.920000+08:00          5.0    0.864336    0.491490   \n",
       "1970-01-02 08:29:10.930000+08:00          5.0    0.998242    0.491106   \n",
       "1970-01-02 08:29:10.940000+08:00          5.6    0.822405    0.491349   \n",
       "1970-01-02 08:29:10.950000+08:00          6.0    0.837220    0.491234   \n",
       "1970-01-02 08:29:10.960000+08:00          6.0    0.860573    0.490922   \n",
       "\n",
       "                                  norm_pos_y  gaze_point_3d_x  \\\n",
       "gaze_timestamp                                                  \n",
       "1970-01-02 08:29:10.770000+08:00    0.291906       -54.359308   \n",
       "1970-01-02 08:29:10.780000+08:00    0.307110       -42.813406   \n",
       "1970-01-02 08:29:10.790000+08:00    0.404853         1.979829   \n",
       "1970-01-02 08:29:10.800000+08:00    0.404822         1.859581   \n",
       "1970-01-02 08:29:10.810000+08:00    0.401053         2.204797   \n",
       "1970-01-02 08:29:10.820000+08:00    0.399335         2.409602   \n",
       "1970-01-02 08:29:10.830000+08:00    0.398559         2.512630   \n",
       "1970-01-02 08:29:10.840000+08:00    0.398804         2.767211   \n",
       "1970-01-02 08:29:10.850000+08:00    0.398257         2.711425   \n",
       "1970-01-02 08:29:10.860000+08:00    0.398524         2.798286   \n",
       "1970-01-02 08:29:10.870000+08:00    0.398724         3.005405   \n",
       "1970-01-02 08:29:10.880000+08:00    0.398582         3.002544   \n",
       "1970-01-02 08:29:10.890000+08:00    0.398328         3.227031   \n",
       "1970-01-02 08:29:10.900000+08:00    0.398221         3.300165   \n",
       "1970-01-02 08:29:10.910000+08:00    0.397330         3.278969   \n",
       "1970-01-02 08:29:10.920000+08:00    0.396538         3.308013   \n",
       "1970-01-02 08:29:10.930000+08:00    0.396239         3.462726   \n",
       "1970-01-02 08:29:10.940000+08:00    0.396675         3.365049   \n",
       "1970-01-02 08:29:10.950000+08:00    0.397143         3.410404   \n",
       "1970-01-02 08:29:10.960000+08:00    0.397230         3.540623   \n",
       "\n",
       "                                  gaze_point_3d_y  gaze_point_3d_z  \\\n",
       "gaze_timestamp                                                       \n",
       "1970-01-02 08:29:10.770000+08:00       103.262224       694.806989   \n",
       "1970-01-02 08:29:10.780000+08:00        41.035419        10.103229   \n",
       "1970-01-02 08:29:10.790000+08:00       -20.040517      -292.334754   \n",
       "1970-01-02 08:29:10.800000+08:00       -19.717564      -287.721641   \n",
       "1970-01-02 08:29:10.810000+08:00       -20.676414      -290.218427   \n",
       "1970-01-02 08:29:10.820000+08:00       -21.335674      -294.369777   \n",
       "1970-01-02 08:29:10.830000+08:00       -21.451642      -293.704395   \n",
       "1970-01-02 08:29:10.840000+08:00       -21.566487      -295.993985   \n",
       "1970-01-02 08:29:10.850000+08:00       -21.777256      -297.274745   \n",
       "1970-01-02 08:29:10.860000+08:00       -21.804480      -298.433361   \n",
       "1970-01-02 08:29:10.870000+08:00       -21.779999      -298.687614   \n",
       "1970-01-02 08:29:10.880000+08:00       -21.876653      -299.589471   \n",
       "1970-01-02 08:29:10.890000+08:00       -22.022033      -300.826326   \n",
       "1970-01-02 08:29:10.900000+08:00       -22.075103      -301.234553   \n",
       "1970-01-02 08:29:10.910000+08:00       -22.336895      -302.166428   \n",
       "1970-01-02 08:29:10.920000+08:00       -22.621279      -303.673027   \n",
       "1970-01-02 08:29:10.930000+08:00       -22.723509      -304.165507   \n",
       "1970-01-02 08:29:10.940000+08:00       -22.609107      -303.908032   \n",
       "1970-01-02 08:29:10.950000+08:00       -22.507586      -303.923452   \n",
       "1970-01-02 08:29:10.960000+08:00       -22.548167      -304.725183   \n",
       "\n",
       "                                  eye_center0_3d_x  eye_center0_3d_y  \\\n",
       "gaze_timestamp                                                         \n",
       "1970-01-02 08:29:10.770000+08:00         -9.967464         14.998960   \n",
       "1970-01-02 08:29:10.780000+08:00          0.021691         14.999306   \n",
       "1970-01-02 08:29:10.790000+08:00         20.000000         15.000000   \n",
       "1970-01-02 08:29:10.800000+08:00         20.000000         15.000000   \n",
       "1970-01-02 08:29:10.810000+08:00         20.000000         15.000000   \n",
       "1970-01-02 08:29:10.820000+08:00         20.000000         15.000000   \n",
       "1970-01-02 08:29:10.830000+08:00         20.000000         15.000000   \n",
       "1970-01-02 08:29:10.840000+08:00         20.000000         15.000000   \n",
       "1970-01-02 08:29:10.850000+08:00         20.000000         15.000000   \n",
       "1970-01-02 08:29:10.860000+08:00         20.000000         15.000000   \n",
       "1970-01-02 08:29:10.870000+08:00         20.000000         15.000000   \n",
       "1970-01-02 08:29:10.880000+08:00         20.000000         15.000000   \n",
       "1970-01-02 08:29:10.890000+08:00         20.000000         15.000000   \n",
       "1970-01-02 08:29:10.900000+08:00         20.000000         15.000000   \n",
       "1970-01-02 08:29:10.910000+08:00         20.000000         15.000000   \n",
       "1970-01-02 08:29:10.920000+08:00         20.000000         15.000000   \n",
       "1970-01-02 08:29:10.930000+08:00         20.000000         15.000000   \n",
       "1970-01-02 08:29:10.940000+08:00         20.000000         15.000000   \n",
       "1970-01-02 08:29:10.950000+08:00         20.000000         15.000000   \n",
       "1970-01-02 08:29:10.960000+08:00         20.000000         15.000000   \n",
       "\n",
       "                                  eye_center0_3d_z  gaze_normal0_x  \\\n",
       "gaze_timestamp                                                       \n",
       "1970-01-02 08:29:10.770000+08:00        -20.037641       -0.061136   \n",
       "1970-01-02 08:29:10.780000+08:00        -20.025094       -0.014355   \n",
       "1970-01-02 08:29:10.790000+08:00        -20.000000        0.065145   \n",
       "1970-01-02 08:29:10.800000+08:00        -20.000000        0.066672   \n",
       "1970-01-02 08:29:10.810000+08:00        -20.000000        0.064772   \n",
       "1970-01-02 08:29:10.820000+08:00        -20.000000        0.063058   \n",
       "1970-01-02 08:29:10.830000+08:00        -20.000000        0.062845   \n",
       "1970-01-02 08:29:10.840000+08:00        -20.000000        0.061422   \n",
       "1970-01-02 08:29:10.850000+08:00        -20.000000        0.061335   \n",
       "1970-01-02 08:29:10.860000+08:00        -20.000000        0.060777   \n",
       "1970-01-02 08:29:10.870000+08:00        -20.000000        0.059995   \n",
       "1970-01-02 08:29:10.880000+08:00        -20.000000        0.059813   \n",
       "1970-01-02 08:29:10.890000+08:00        -20.000000        0.058765   \n",
       "1970-01-02 08:29:10.900000+08:00        -20.000000        0.058422   \n",
       "1970-01-02 08:29:10.910000+08:00        -20.000000        0.058302   \n",
       "1970-01-02 08:29:10.920000+08:00        -20.000000        0.057891   \n",
       "1970-01-02 08:29:10.930000+08:00        -20.000000        0.057256   \n",
       "1970-01-02 08:29:10.940000+08:00        -20.000000        0.057648   \n",
       "1970-01-02 08:29:10.950000+08:00        -20.000000        0.057488   \n",
       "1970-01-02 08:29:10.960000+08:00        -20.000000        0.056879   \n",
       "\n",
       "                                  gaze_normal0_y  gaze_normal0_z  \\\n",
       "gaze_timestamp                                                     \n",
       "1970-01-02 08:29:10.770000+08:00        0.121556        0.984479   \n",
       "1970-01-02 08:29:10.780000+08:00        0.095046        0.987478   \n",
       "1970-01-02 08:29:10.790000+08:00        0.027374        0.997500   \n",
       "1970-01-02 08:29:10.800000+08:00        0.024890        0.997463   \n",
       "1970-01-02 08:29:10.810000+08:00        0.024500        0.997599   \n",
       "1970-01-02 08:29:10.820000+08:00        0.025140        0.997693   \n",
       "1970-01-02 08:29:10.830000+08:00        0.027284        0.997650   \n",
       "1970-01-02 08:29:10.840000+08:00        0.025921        0.997775   \n",
       "1970-01-02 08:29:10.850000+08:00        0.026011        0.997778   \n",
       "1970-01-02 08:29:10.860000+08:00        0.025339        0.997830   \n",
       "1970-01-02 08:29:10.870000+08:00        0.025130        0.997882   \n",
       "1970-01-02 08:29:10.880000+08:00        0.025071        0.997894   \n",
       "1970-01-02 08:29:10.890000+08:00        0.024700        0.997966   \n",
       "1970-01-02 08:29:10.900000+08:00        0.024264        0.997997   \n",
       "1970-01-02 08:29:10.910000+08:00        0.025038        0.997985   \n",
       "1970-01-02 08:29:10.920000+08:00        0.025402        0.997999   \n",
       "1970-01-02 08:29:10.930000+08:00        0.025568        0.998032   \n",
       "1970-01-02 08:29:10.940000+08:00        0.025339        0.998015   \n",
       "1970-01-02 08:29:10.950000+08:00        0.024511        0.998045   \n",
       "1970-01-02 08:29:10.960000+08:00        0.024088        0.998090   \n",
       "\n",
       "                                  eye_center1_3d_x  eye_center1_3d_y  \\\n",
       "gaze_timestamp                                                         \n",
       "1970-01-02 08:29:10.770000+08:00               NaN               NaN   \n",
       "1970-01-02 08:29:10.780000+08:00        -39.934928         14.997919   \n",
       "1970-01-02 08:29:10.790000+08:00        -39.934928         14.997919   \n",
       "1970-01-02 08:29:10.800000+08:00        -39.934928         14.997919   \n",
       "1970-01-02 08:29:10.810000+08:00        -39.934928         14.997919   \n",
       "1970-01-02 08:29:10.820000+08:00        -39.934928         14.997919   \n",
       "1970-01-02 08:29:10.830000+08:00        -39.934928         14.997919   \n",
       "1970-01-02 08:29:10.840000+08:00        -39.934928         14.997919   \n",
       "1970-01-02 08:29:10.850000+08:00        -39.934928         14.997919   \n",
       "1970-01-02 08:29:10.860000+08:00        -39.934928         14.997919   \n",
       "1970-01-02 08:29:10.870000+08:00        -39.934928         14.997919   \n",
       "1970-01-02 08:29:10.880000+08:00        -39.934928         14.997919   \n",
       "1970-01-02 08:29:10.890000+08:00        -39.934928         14.997919   \n",
       "1970-01-02 08:29:10.900000+08:00        -39.934928         14.997919   \n",
       "1970-01-02 08:29:10.910000+08:00        -39.934928         14.997919   \n",
       "1970-01-02 08:29:10.920000+08:00        -39.934928         14.997919   \n",
       "1970-01-02 08:29:10.930000+08:00        -39.934928         14.997919   \n",
       "1970-01-02 08:29:10.940000+08:00        -39.934928         14.997919   \n",
       "1970-01-02 08:29:10.950000+08:00        -39.934928         14.997919   \n",
       "1970-01-02 08:29:10.960000+08:00        -39.934928         14.997919   \n",
       "\n",
       "                                  eye_center1_3d_z  gaze_normal1_x  \\\n",
       "gaze_timestamp                                                       \n",
       "1970-01-02 08:29:10.770000+08:00               NaN             NaN   \n",
       "1970-01-02 08:29:10.780000+08:00        -20.075283       -0.145087   \n",
       "1970-01-02 08:29:10.790000+08:00        -20.075283       -0.150232   \n",
       "1970-01-02 08:29:10.800000+08:00        -20.075283       -0.152198   \n",
       "1970-01-02 08:29:10.810000+08:00        -20.075283       -0.151952   \n",
       "1970-01-02 08:29:10.820000+08:00        -20.075283       -0.150413   \n",
       "1970-01-02 08:29:10.830000+08:00        -20.075283       -0.151138   \n",
       "1970-01-02 08:29:10.840000+08:00        -20.075283       -0.150791   \n",
       "1970-01-02 08:29:10.850000+08:00        -20.075283       -0.149916   \n",
       "1970-01-02 08:29:10.860000+08:00        -20.075283       -0.149606   \n",
       "1970-01-02 08:29:10.870000+08:00        -20.075283       -0.150185   \n",
       "1970-01-02 08:29:10.880000+08:00        -20.075283       -0.149704   \n",
       "1970-01-02 08:29:10.890000+08:00        -20.075283       -0.149820   \n",
       "1970-01-02 08:29:10.900000+08:00        -20.075283       -0.149847   \n",
       "1970-01-02 08:29:10.910000+08:00        -20.075283       -0.149284   \n",
       "1970-01-02 08:29:10.920000+08:00        -20.075283       -0.148602   \n",
       "1970-01-02 08:29:10.930000+08:00        -20.075283       -0.148867   \n",
       "1970-01-02 08:29:10.940000+08:00        -20.075283       -0.148678   \n",
       "1970-01-02 08:29:10.950000+08:00        -20.075283       -0.148821   \n",
       "1970-01-02 08:29:10.960000+08:00        -20.075283       -0.148850   \n",
       "\n",
       "                                  gaze_normal1_y  gaze_normal1_z  \n",
       "gaze_timestamp                                                    \n",
       "1970-01-02 08:29:10.770000+08:00             NaN             NaN  \n",
       "1970-01-02 08:29:10.780000+08:00        0.230744        0.962137  \n",
       "1970-01-02 08:29:10.790000+08:00        0.224797        0.962738  \n",
       "1970-01-02 08:29:10.800000+08:00        0.229156        0.961410  \n",
       "1970-01-02 08:29:10.810000+08:00        0.234021        0.960284  \n",
       "1970-01-02 08:29:10.820000+08:00        0.234215        0.960478  \n",
       "1970-01-02 08:29:10.830000+08:00        0.233532        0.960531  \n",
       "1970-01-02 08:29:10.840000+08:00        0.233569        0.960577  \n",
       "1970-01-02 08:29:10.850000+08:00        0.233780        0.960662  \n",
       "1970-01-02 08:29:10.860000+08:00        0.233583        0.960758  \n",
       "1970-01-02 08:29:10.870000+08:00        0.233384        0.960716  \n",
       "1970-01-02 08:29:10.880000+08:00        0.233300        0.960812  \n",
       "1970-01-02 08:29:10.890000+08:00        0.233547        0.960734  \n",
       "1970-01-02 08:29:10.900000+08:00        0.233968        0.960627  \n",
       "1970-01-02 08:29:10.910000+08:00        0.234162        0.960668  \n",
       "1970-01-02 08:29:10.920000+08:00        0.234394        0.960717  \n",
       "1970-01-02 08:29:10.930000+08:00        0.234479        0.960655  \n",
       "1970-01-02 08:29:10.940000+08:00        0.234164        0.960761  \n",
       "1970-01-02 08:29:10.950000+08:00        0.234277        0.960712  \n",
       "1970-01-02 08:29:10.960000+08:00        0.234256        0.960712  "
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data5.head(20)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
